"Content-addressable memories" (CAMS) are used in memory cache systems. They perform a matching process that determines whether the cache contains data needed elsewhere in the system, such as data requested a processor.
With a general purpose computer that uses a CAM, as with all cache systems, when a processor identifies the data it needs, the CAM must check its memory to determine if the identified data is located in the CAM. In other words, it determines whether the data is a cache entry or whether it is stored only in main (non-cache) memory. With the CAM approach, this checking process is performed. by storing "tags", each of which may be part of the address of each cache entry, in the CAM. The CAM compares each tag to a "target tag" issued by the processor. If there is a match, the data is located in the CAM. If not, the data is fetched from main memory.
Conventional CAMs simultaneously compare the target tag to every bit of all tags. They accomplish this comparison by using special tag memory cells ("tag cells"). Each tag cell is like a conventional RAM cell, with an associated bitline and wordline and data storage components, but also has a comparator. The comparator compares a signal on a bitline to the cell's contents and places the result on a readline. The comparators of all cells in the CAM are turned on at once so that each cell may perform its comparison at the same time as all other cells.
FIG. 1 illustrates a prior art CAM 100 that has a comparator (switches 107 and 108) for each tag cell 102. Bitlines 101 carry consecutive bits of the target tag (and the complementary bits) simultaneously to the cells 102. Each bit of the target tag is compared to the contents of the cells 102 as indicated by the state of a pair of inverters 104. Each row of cells 102 has an associated matchline 103, which is precharged to Vcc. Switches 105 are activated by wordlines 106. A pair of series-connected switching transistors 107 and 108 are controlled by the output of each inverter 104. Switching transistors 107 and 108 connect matchline 103 to ground and must both be activated to discharge matchline 103. This discharge will occur only when the cell contents do not match the target tag bit on the bitline. Thus, for each row, the matchline 103 goes low when there is a mismatch. If the matchline of any row remains at Vcc, a match on that row is indicated. An OR gate (not shown) may be used to provide a global hit signal from the CAM 100.
This conventional method of configuring and simultaneously comparing contents of tag cells of a CAM is costly in terms of die area and the resulting current spike in the power supply. For CAMs that store a large number of entries, such as those used in packet communication systems, the current spikes can cause problems.